//获取列表
 
import http from '../../utils/reuqest'
import { AccountParams, Auth, Captcha, LoginModel } from './type'
export const getAccountList = (data:AccountParams) => {
  return http.get('/account/list', data)
}

export const delAccount=(id:number)=>{
 
    return  http.delete(`/account/delete/${id}`);
  
}

export const delAccounts=(ids:number[])=>{
 
    return  http.post(`/account/deleteAll/`,ids);
  
}
//获取公钥
export const getPublicKey=()=>{
  return http.get<string>('/auth/publicKey')
}

//登录

export const login=(data:Auth)=>{
  return http.post<LoginModel>('/auth/login',data)
}

//获取图形验证码

export const getCaptcha=()=>{
  return http.get<Captcha>('/auth/getCaptcha')
}

//微信扫码code登录

export const wechatLogin=(code:string)=>{
  return http.get<LoginModel>('/auth/wechat',{code})
}
